<template>
	<view>
		<u-parse :content="content"></u-parse>
	</view>
</template>

<script>
	const app = getApp()
	import uParse from '@/components/u-parse/u-parse.vue';
	export default {
		data() {
			return {
				content: '',
				type: ''
			}
		},
		components:{uParse},
		onLoad(opt) {
			this.type = opt.type
			if( opt.type == 1 ){
				uni.setNavigationBarTitle({
					title: '隐私政策'
				});
			}else if(opt.type == 2){
				uni.setNavigationBarTitle({
					title: '购买服务协议'
				});
			}
			this.getAbout()
		},
		methods: {
			/* 获取关于数据 */
			getAbout() {
				let that = this;
				app.globalRequest({
					api: app.getApi().loginApi.getxieYi,
					data:{
						type: that.type
					}
				}).then(res => {
					if (res.code == 1) {
						that.content = res.data.xieyi.content;
					}
				}).catch(err => {
			
				})
			},
		}
	}
</script>

<style lang="scss">
   page{
	   padding: 20rpx;
	   box-sizing: border-box;
	   background-color: #fff!important;
   }
</style>
